package com.gao.flying.mq.config;

import org.apache.commons.digester3.annotations.rules.ObjectCreate;
import org.apache.commons.digester3.annotations.rules.SetNext;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gaojh
 * @date 2016/7/12
 */
@ObjectCreate(pattern = "config")
public class Config {

    private List<Broker> brokers = new ArrayList<Broker>();
    private List<Dest> dests = new ArrayList<Dest>();
    private Scan scan;

    @SetNext
    public void addBroker(Broker broker){
        this.brokers.add(broker);
    }

    public List<Broker> getBrokers() {
        return brokers;
    }

    @SetNext
    public void addDest(Dest dest){
        this.dests.add(dest);
    }

    public List<Dest> getDests() {
        return dests;
    }

    public Scan getScan() {
        return scan;
    }

    @SetNext
    public void setScan(Scan scan) {
        this.scan = scan;
    }
}
